<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var email = prompt("请输入你的邮箱");
        if ( (/^[a-zA-Z0-9]{2,}@\w{2,6}[.com | .cn]+$/.test(email))) {
            alert("登录成功");
        } else {
            alert("请注意格式");
        }
    </script>
</head>
<body>

</body>
</html>